#pragma once
#include "GpuProgram.h"
#include "Singleton.h"

namespace DreamEngine
{

class _EngineExport CGpuProgramManager : public CEngineObject, public CSingleton<CGpuProgramManager>
{
public:

	CGpuProgramManager(void);
	virtual ~CGpuProgramManager(void);

	static CGpuProgramManager&	Instance(void);
	static CGpuProgramManager*	InstancePtr(void);

	virtual CGpuProgram*		CreateGpuProgram(ShaderProfile profile)	;

	virtual CGpuProgram*		CreateAndInitGpuProgram(ShaderProfile profile, 
														const CString& fileName,
														const CString& enterFun);

	virtual void				DestoryAll(void);

protected:

	typedef std::vector<CGpuProgram*>  GPUProgramLst;
	GPUProgramLst				m_gpuPrograms;

	virtual CGpuProgram*		_NewProgramByProfile(ShaderProfile profile)=0;
};

template<> CGpuProgramManager* CSingleton<CGpuProgramManager>::m_singleton = 0;
}


